﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Strive.Util.Text;
using Strive.Util.Logging;
using Strive.Core.Validations;
using Strive.Core.Service;
using Strive.Core.Translators;
using Strive.Util.Maths;
using Strive.Reflection;
using Strive.Aspects;
using Strive.Interface.IDataAccessBase.DAO;
using Strive.DataAccess.Base.Model.PageObject;
using Strive.DataAccess.Base.Model.SearcherObject;
using Strive.DataAccess;

using OTA.Notification.DAO.Message;
using OTA.Notification.Entity.Model.Message;

using OTA.Notification.Interface.IDAO.Message;

namespace OTA.Notification.DAO.Message
{
    public class RepeatMsgDao : BaseDAOBean<RepeatMsgBean>, IRepeatMsgDao
    {

        public RepeatMsgDao() : base("notifyDB") { }

        #region IBaseDAOBean<RepeatMsgBean>Bean的实现

        /// <summary>
        /// 插入实体
        /// </summary>
        /// <param name="obj">RepeatMsgBean</param>
        /// <returns>影响行数</returns>
        public int DataInsert(RepeatMsgBean obj)
        {
            return base.Insert(obj);
        }

        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="obj">RepeatMsgBean</param>
        /// <returns>更新数目</returns>
        public int DataUpdate(RepeatMsgBean obj)
        {
            return base.Update(obj);
        }

        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="PK">RepeatMsgBean</param>
        /// <returns>删除数目</returns>
        public int DataDelete(RepeatMsgBean obj)
        {
            return base.Delete(obj);
        }

        /// <summary>
        /// 根据PK得到实体,
        /// </summary>
        /// <param name="PK">PK</param>
        /// <returns>实体</returns>
        public RepeatMsgBean DataSelect(int key)
        {
            return base.GetObject(key);
        }

        /// <summary>
        /// 获得所有实体
        /// </summary>
        /// <returns>实体集合</returns>
        /// <remarks>建议在一万数据以下使用该方法</remarks>
        public IList<RepeatMsgBean> SelectAll()
        {
            return base.GetObjectList();
        }

        #endregion

        #region MsgProtocolConfigDao扩展

        /// <summary>
        /// 批量删除实体
        /// </summary>
        /// <param name="list">MsgProtocolConfigBean集合</param>
        /// <returns>删除数目</returns>
        public int DataDelete(IList<RepeatMsgBean> list)
        {
            return base.Delete(list);
        }

        /// <summary>
        /// 根据主键删除实体
        /// </summary>
        /// <param name="key">主键</param>
        /// <returns>删除数目</returns>
        public int DataDelete(int key)
        {
            return base.Delete(base.Query.Constrain("ID").Equal(key));
        }

        /// <summary>
        /// 批量插入实体
        /// </summary>
        /// <param name="obj">RepeatMsgBean集合</param>
        /// <returns>影响行数</returns>
        public int DataInsert(IList<RepeatMsgBean> list)
        {
            return base.Insert(list);
        }

        /// <summary>
        /// 批量更新实体
        /// </summary>
        /// <param name="obj">RepeatMsgBean集合</param>
        /// <returns>更新数目</returns>
        public int DataUpdate(IList<RepeatMsgBean> list)
        {
            return base.Update(list);
        }

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageObject">分页对象</param>
        /// <returns>集合</returns>
        /// <remarks>测试百万级数据在10秒内,比MSSQL2005分页性能要高</remarks>
        public PageResult<RepeatMsgBean> SelectPageList(BasePageSearch pageObject)
        {
            return base.QueryPageList(pageObject);
        }

        #endregion
    }
}
